package com.taru.wxhsh.service.impl;

import com.taru.wxhsh.mapper.UserMapper;
import com.taru.wxhsh.pojo.User;
import com.taru.wxhsh.service.UserService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    UserMapper  userMapper;

    @Override
    public List<User> findUsersList(String telphone,String shopName) {
        List<User> list =userMapper.selectList(telphone==null?null:telphone.trim(),shopName==null?null:shopName.trim());
        return list;
    }

    @Override
    public void addUser(User user) {
        userMapper.insertSelective(user);
    }

    @Override
    public int deleteByPrimaryKey(String userId) {
        return userMapper.deleteByPrimaryKey(userId);
    }

    @Override
    public User selectByPrimaryKey(String userId) {
        return userMapper.selectByPrimaryKey(userId);
    }

    @Override
    public int updateByPrimaryKeySelective(User record) {
        return userMapper.updateByPrimaryKeySelective(record);
    }
}
